#include"processpool.hpp"
void Usage(std::string proc)
{
    std::cout << "Usage: " << proc << "process-num" << std::endl;
}
// 父进程管理子进程
int main(int argc, char *argv[])
{
    // 输入格式错误
    if (argc != 2)
    {
        Usage(argv[0]);
        return USAGEERROR;
    }
     int num = std::stoi(argv[1]);
    processpool*pool=new processpool(num,Works);
   pool->InitProcessPool();
   pool->RotaTasks();
   pool->CleanProcessPool();
    // std::vector<Channel> channels;
    // // 1.初始化
    // InitProcessPool(num, channels, Works);
    // // DeBug(channels);//打印子进程名称，测试
    // // 2.分派任务，轮流
    // RotaTasks(channels);
    // //3.退出进程池

    return 0;
}